#!/usr/bin/env python3.3
import sys, array

#option1
#inputFileName = "inputTest.binary"
#option2
inputFileName = "/home/diaosi/outputDirForIndexes/prunedGov2Index/prunedGov2IndexBasedOn_PartialBM25/wei_pruning_development_universal_cutting_2013-02-13-11-57-39-1-2.ext"

inputFileHandler = open(inputFileName,"rb")

outputFileName = "outputTest.binary"
outputFileHandler = open(outputFileName,"wb")

values = array.array('f') # array of float

# a = array.array('f', sys.stdin.buffer.read())
values.fromfile(inputFileHandler, 13)
# a = array.array('f', [1.0,3.3,4.3,1.2])

values = list(values)
values.sort()

print(type(values))
print(values)


values = array.array('f', values)
print(type(values))
outputFileHandler.write(values)
outputFileHandler.close()


print("done")